<%@ page language="java" contentType="text/html;charset=utf-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html>
<!--[if IE 8]> <html lang="en" class="ie8 no-js"> <![endif]-->
<!--[if IE 9]> <html lang="en" class="ie9 no-js"> <![endif]-->
<!--[if !IE]><!-->
<html lang="en" class="no-js">
<!--<![endif]-->
<head>
    <jsp:include page="../common/common.jsp"/>

    <link href="${path}/assets/css/weixin/appmsg.css" rel="stylesheet" type="text/css"/>
    <link href="${path}/assets/css/pages/timeline.css" rel="stylesheet" type="text/css">
</head>
<body class="page-header-fixed page-sidebar-fixed">
<jsp:include page="../common/header.jsp"/>
<div class="clearfix">
</div>
<div class="page-container">
<div class="page-sidebar-wrapper"><jsp:include page="../common/menu.jsp"/></div>
<div class="page-content-wrapper">
<div class="page-content">
<div class="row">
<div class="col-md-12">
<div class="portlet box purple">
<div class="portlet-title">
    <div class="caption">
        <i class="fa fa-shopping-cart"></i>添加采集点
    </div>
     <div class="actions btn-set">
           <a href="javascript:history.go(-1);" class="btn default"><i
                   class="fa fa-angle-left"></i> 返回</a>
           <a href="javascript:location.reload();" class="btn green"><i
                   class="fa fa-reply"></i> 重置</a>
           <button type="button" id="btnSave" class="btn blue" onclick="save()"><i class="fa fa-check"></i> 保存
           </button>
     </div>
</div>
<div class="portlet-body">
<div class="tabbable">
<ul class="nav nav-tabs nav-tabs-lg">
    <li class="active">
        <a href="#tab_1_1"  data-toggle="tab">
            列表页规则
        </a>
    </li>
    <li>
        <a href="#tab_1_2" data-toggle="tab">
            内容页规则
        </a>
    </li>
</ul>

<form class="form-horizontal form-row-seperated" action="${path}/robotManager/save" id="formDetail">
<input type="hidden" id="id" name="id" value="${robotManager.id}">

<div class="tab-content">

<div class="tab-pane fade active in" id="tab_1_1">
<div class="row">
<div class="col-md-12">
        <div class="form-body">
        <div class="form-group">
                <label class="col-md-2 control-label">采集项目名称:<span class="required">*</span></label>
                <div class="col-md-5">
                    <input type="text" id="name" name="name" class="form-control measure-input" value="${robotManager.name}"/>
                </div>
            </div>
            <div class="form-group">
                <label class="col-md-2 control-label">采集页面编码:<span class="required">*</span></label>
                <div class="col-md-5">
                    <select id="charset" name="charset" class="form-control">
                        <option value="GBK">GBK</option>
                        <option value="UTF-8">UTF-8</option>
                        <option value="BIG5">BIG5</option>
                    </select>
                </div>
            </div>
            <%-- <div class="form-group">
                <label class="col-md-2 control-label">网址类型:<span class="required">*</span></label>
                <div class="col-md-5">
                    <select id="type" name="type" class="form-control">
                        <option value="0"> 单一网页</option>
                        <option value="1">多个网页</option>
                        <option value="2"> 序列网址</option>
                        <option value="3">RSS</option>
                    </select>
                </div>
            </div> --%>
            
            <div class="form-group">
                <label class="col-md-2 control-label">采集列表地址:</label>
                <div class="col-md-3">               
                    <textarea cols="50" id="url" name="url" rows="5" style="border: 1px solid #e5e5e5;">${robotManager.url}</textarea>
                    <span class="">每行一条</span>
                </div>
            </div>
            <div class="form-group">
                <label class="col-md-2 control-label">网址过滤:<span class="required">*</span></label>
                <div class="col-md-3">
                    <input type="text" id="contain" name="contain" class="form-control" value="${robotManager.contain}" placeholder="网址中必须包含"/>
                </div>
                <div class="col-md-3">
                     <input type="text" id="exclusive" name="exclusive" class="form-control" value="${robotManager.exclusive}" placeholder="网址中不得包含"/>                                                                                                                       
                </div>
            </div>
            
            <div class="form-group">
                <label class="col-md-2 control-label">列表起止:从</label>
                <div class="col-md-3">
                 <textarea cols="50" id="startflag" name="startflag" rows="5" style="border: 1px solid #e5e5e5;">${robotManager.startflag}</textarea>
                </div>
                <label class="col-md-2 control-label">到</label>
                <div class="col-md-3">
                 <textarea cols="50" id="endflag" name="endflag" rows="5" style="border: 1px solid #e5e5e5;">${robotManager.endflag}</textarea>
                </div>
            </div>
            
            <div class="form-group">
               <label class="col-md-2 control-label">发布到:
                   <span class="required">*</span>
               </label>

               <div class="col-md-3">
                   <select id="pid" class="form-control" name="pid">
                       <c:forEach items="${column}" var="s">
                           <option value="${s.id}" <c:if test="${robotManager.cv.pid == s.id || robotManager.cv.id == s.id}">selected</c:if> >${s.value0}</option>
                       </c:forEach>
                   </select>
               </div>
               <div class="col-md-2">
                   <select id="columnId" name="columnId" class="form-control"></select>
               </div>
           </div>           
           
        </div>
     <div class="portlet box purple">
		<div class="portlet-title">
		     <div class="actions btn-set">
	           <a href="javascript:history.go(-1);" class="btn default"><i class="fa fa-angle-left"></i> 返回</a>
	           <a href="javascript:location.reload();" class="btn green"><i class="fa fa-reply"></i> 重置</a>
	           <button type="button" id="btnSave" class="btn blue" onclick="save()"><i class="fa fa-check"></i> 保存 </button>
		     </div>
		</div>
   </div>
</div>
</div>
</div>

<div class="tab-pane fade " id="tab_1_2">
    <div class="form-body">
        <div class="form-group">
            <label class="col-md-2 control-label">标题匹配规则:</label>
            <div class="col-md-3">
             <textarea cols="40" id="matcher_title" name="matcher_title" rows="5" style="border: 1px solid #e5e5e5;">${robotManager.matcher_title}</textarea>
            </div>
            <label class="col-md-2 control-label">标题过滤选项:</label>
            <div class="col-md-3">
             <textarea cols="40" id="filter_title" name="filter_title" rows="5" style="border: 1px solid #e5e5e5;">${robotManager.filter_title}</textarea>
            </div>
        </div>
        <div class="form-group">
            <label class="col-md-2 control-label">作者匹配规则:</label>
            <div class="col-md-3">
             <textarea cols="40" id="matcher_author" name="matcher_author" rows="5" style="border: 1px solid #e5e5e5;">${robotManager.matcher_author}</textarea>
            </div>
            <label class="col-md-2 control-label">作者过滤选项:</label>
            <div class="col-md-3">
             <textarea cols="40" id="filter_author" name="filter_author" rows="5" style="border: 1px solid #e5e5e5;">${robotManager.filter_author}</textarea>
            </div>
        </div>
        <div class="form-group">
            <label class="col-md-2 control-label">来源匹配规则:</label>
            <div class="col-md-3">
             <textarea cols="40" id="matcher_source" name="matcher_source" rows="5" style="border: 1px solid #e5e5e5;">${robotManager.matcher_source}</textarea>
            </div>
            <label class="col-md-2 control-label">来源过滤选项:</label>
            <div class="col-md-3">
             <textarea cols="40" id="filter_source" name="filter_source" rows="5" style="border: 1px solid #e5e5e5;">${robotManager.filter_source}</textarea>
            </div>
        </div>
        <div class="form-group">
            <label class="col-md-2 control-label">内容匹配规则:</label>
            <div class="col-md-3">
             <textarea cols="40" id="matcher_content" name="matcher_content" rows="5" style="border: 1px solid #e5e5e5;">${robotManager.matcher_content}</textarea>
            </div>
            <label class="col-md-2 control-label">内容过滤选项:</label>
            <div class="col-md-3">
             <textarea cols="40" id="filter_content" name="filter_content" rows="5" style="border: 1px solid #e5e5e5;">${robotManager.filter_content}</textarea>
            </div>
        </div>
    </div>
    <div class="portlet box purple">
	    <div class="portlet-title">
	        <div class="actions btn-set">
	            <a href="javascript:history.go(-1);" class="btn default"><i class="fa fa-angle-left"></i> 返回</a>
	            <a href="javascript:location.reload();" class="btn green"><i class="fa fa-reply"></i> 重置</a>
	            <button type="button" id="btnSave" class="btn blue" onclick="save()"><i class="fa fa-check"></i> 保存 </button>
	        </div>
	    </div>
    </div>
</div>

</div>
</form>
<div class="clearfix margin-bottom-20"></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<jsp:include page="../common/footer.jsp"/>
<script type="text/javascript" src="${path}/robotManager/js/robotManager.js"></script>
<script type="text/javascript" src="${path}/assets/plugins/district/linkagesel-min.js"></script>

<script>
    jQuery(document).ready(function () {
    	$("#charset").find("option[value='${robotManager.charset}']").attr("selected",true);
    	$("#type").find("option[value='${robotManager.type}']").attr("selected",true);
    	changeSecondType($("#pid").val(),"${robotManager.columnId}");
        $("#pid").change(function() {
            changeSecondType(this.value);
        });
    });
</script>

</body>
</html>